.class public abstract Lcom/vividsolutions/jts/index/quadtree/NodeBase;
.super Ljava/lang/Object;
.source "NodeBase.java"


# instance fields
.field protected items:Ljava/util/List;

.field protected subnode:[Lcom/vividsolutions/jts/index/quadtree/Node;


# direct methods
.method public constructor <init>()V
    .locals 1

    .line 90
    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    .line 78
    new-instance v0, Ljava/util/ArrayList;

    invoke-direct {v0}, Ljava/util/ArrayList;-><init>()V

    iput-object v0, p0, Lcom/vividsolutions/jts/index/quadtree/NodeBase;->items:Ljava/util/List;

    const/4 v0, 0x4

    .line 88
    new-array v0, v0, [Lcom/vividsolutions/jts/index/quadtree/Node;

    iput-object v0, p0, Lcom/vividsolutions/jts/index/quadtree/NodeBase;->subnode:[Lcom/vividsolutions/jts/index/quadtree/Node;

    return-void
.end method

.method public static getSubnodeIndex(Lcom/vividsolutions/jts/geom/Envelope;Lcom/vividsolutions/jts/geom/Coordinate;)I
    .locals 6

    .line 67
    invoke-virtual {p0}, Lcom/vividsolutions/jts/geom/Envelope;->getMinX()D

    move-result-wide v0

    iget-wide v2, p1, Lcom/vividsolutions/jts/geom/Coordinate;->x:D

    const/4 v4, -0x1

    cmpl-double v5, v0, v2

    if-ltz v5, :cond_1

    .line 68
    invoke-virtual {p0}, Lcom/vividsolutions/jts/geom/Envelope;->getMinY()D

    move-result-wide v0

    iget-wide v2, p1, Lcom/vividsolutions/jts/geom/Coordinate;->y:D

    cmpl-double v5, v0, v2

    if-ltz v5, :cond_0

    const/4 v4, 0x3

    .line 69
    :cond_0
    invoke-virtual {p0}, Lcom/vividsolutions/jts/geom/Envelope;->getMaxY()D

    move-result-wide v0

    iget-wide v2, p1, Lcom/vividsolutions/jts/geom/Coordinate;->y:D

    cmpg-double v5, v0, v2

    if-gtz v5, :cond_1

    const/4 v4, 0x1

    .line 71
    :cond_1
    invoke-virtual {p0}, Lcom/vividsolutions/jts/geom/Envelope;->getMaxX()D

    move-result-wide v0

    iget-wide v2, p1, Lcom/vividsolutions/jts/geom/Coordinate;->x:D

    cmpg-double v5, v0, v2

    if-gtz v5, :cond_3

    .line 72
    invoke-virtual {p0}, Lcom/vividsolutions/jts/geom/Envelope;->getMinY()D

    move-result-wide v0

    iget-wide v2, p1, Lcom/vividsolutions/jts/geom/Coordinate;->y:D

    cmpl-double v5, v0, v2

    if-ltz v5, :cond_2

    const/4 v4, 0x2

    .line 73
    :cond_2
    invoke-virtual {p0}, Lcom/vividsolutions/jts/geom/Envelope;->getMaxY()D

    move-result-wide v0

    iget-wide p0, p1, Lcom/vividsolutions/jts/geom/Coordinate;->y:D

    cmpg-double v2, v0, p0

    if-gtz v2, :cond_3

    const/4 v4, 0x0

    :cond_3
    return v4
.end method

.method private visitItems(Lcom/vividsolutions/jts/geom/Envelope;Lcom/vividsolutions/jts/index/ItemVisitor;)V
    .locals 1

    .line 214
    iget-object p1, p0, Lcom/vividsolutions/jts/index/quadtree/NodeBase;->items:Ljava/util/List;

    invoke-interface {p1}, Ljava/util/List;->iterator()Ljava/util/Iterator;

    move-result-object p1

    :goto_0
    invoke-interface {p1}, Ljava/util/Iterator;->hasNext()Z

    move-result v0

    if-eqz v0, :cond_0

    .line 215
    invoke-interface {p1}, Ljava/util/Iterator;->next()Ljava/lang/Object;

    move-result-object v0

    invoke-interface {p2, v0}, Lcom/vividsolutions/jts/index/ItemVisitor;->visitItem(Ljava/lang/Object;)V

    goto :goto_0

    :cond_0
    return-void
.end method


# virtual methods
.method public add(Ljava/lang/Object;)V
    .locals 1

    .line 99
    iget-object v0, p0, Lcom/vividsolutions/jts/index/quadtree/NodeBase;->items:Ljava/util/List;

    invoke-interface {v0, p1}, Ljava/util/List;->add(Ljava/lang/Object;)Z

    return-void
.end method

.method protected abstract isSearchMatch(Lcom/vividsolutions/jts/geom/Envelope;)Z
.end method

.method public visit(Lcom/vividsolutions/jts/geom/Envelope;Lcom/vividsolutions/jts/index/ItemVisitor;)V
    .locals 3

    .line 197
    invoke-virtual {p0, p1}, Lcom/vividsolutions/jts/index/quadtree/NodeBase;->isSearchMatch(Lcom/vividsolutions/jts/geom/Envelope;)Z

    move-result v0

    if-nez v0, :cond_0

    return-void

    .line 202
    :cond_0
    invoke-direct {p0, p1, p2}, Lcom/vividsolutions/jts/index/quadtree/NodeBase;->visitItems(Lcom/vividsolutions/jts/geom/Envelope;Lcom/vividsolutions/jts/index/ItemVisitor;)V

    const/4 v0, 0x0

    :goto_0
    const/4 v1, 0x4

    if-ge v0, v1, :cond_2

    .line 205
    iget-object v1, p0, Lcom/vividsolutions/jts/index/quadtree/NodeBase;->subnode:[Lcom/vividsolutions/jts/index/quadtree/Node;

    aget-object v2, v1, v0

    if-eqz v2, :cond_1

    .line 206
    aget-object v1, v1, v0

    invoke-virtual {v1, p1, p2}, Lcom/vividsolutions/jts/index/quadtree/NodeBase;->visit(Lcom/vividsolutions/jts/geom/Envelope;Lcom/vividsolutions/jts/index/ItemVisitor;)V

    :cond_1
    add-int/lit8 v0, v0, 0x1

    goto :goto_0

    :cond_2
    return-void
.end method
